import accountAdminApiConfig from '@/core/account/generated/apiconfig/accountAdminApiConfig'
import serverApiMockUtils from '../../utils/serverApiMockUtils'
import mockProdServerUtils from '../../utils/mockUtils'
import { MockMethod } from 'vite-plugin-mock'
import Mock from 'mockjs'
import IamAccountResponse from '@/core/account/generated/types/model/response/IamAccountResponse'

const content: IamAccountResponse[] = []
for (let i = 0; i < 10; i++) {
	content.push({
		id: i.toString(),
		iamAppId: i.toString(),
		passwordChangeRequired: Math.floor(Math.random() * 2) + 1 === 1,
		status: i,
		deleteFlag: '0',
		createTime: new Date().getTime().toString(),
		updateTime: new Date().getTime().toString(),
		rowVersion: 1,
	} as IamAccountResponse)
}

const mockList: MockMethod[] = [...serverApiMockUtils.getDefaultServerApi(accountAdminApiConfig.iamAccount, content)]

mockProdServerUtils.addMockList(...mockList)

export const items = content
